package pers.cz.business;

import pers.cz.mapper.SystemJobLogMapper;
import pers.cz.mapper.TaskJobReportMapper;
import pers.cz.model.SystemJobLog;
import pers.cz.model.TaskJobReport;
import pers.cz.mybatisPlugin.PageRowBounds;
import pers.cz.pub.AbstractBusiness;

import java.util.List;

/**
 * @program: PostGirl-panent
 * @description: TaskJobHisBusiness
 * @author: Cheng Zhi
 * @create: 2021-10-31 14:34
 **/
public class TaskJobHisBusiness extends AbstractBusiness {


    public List<SystemJobLog> queryAllJobLogByPage(Integer jobId, Integer pageStart, Integer pageLimit) {

        PageRowBounds pageRowBounds = new PageRowBounds(pageStart, pageLimit);
        return this.getMapper(SystemJobLogMapper.class).selectAllJobLogByPage(pageRowBounds,jobId);
    }

    public Integer queryJobLogCountNum(Integer jobId) {

        return this.getMapper(SystemJobLogMapper.class).selectCountNum(jobId);
    }

    /**
     * 根据流水号获取job执行的测试报告名称
     * @param soNbr
     * @return
     */
    public TaskJobReport queryReporyNameBySonbr(Long soNbr) {

        return this.getMapper(TaskJobReportMapper.class).selectByPrimaryKey(soNbr);
    }

    public Integer deleteJobLog(Integer id) {

        return this.getMapper(SystemJobLogMapper.class).deleteByPrimaryKey(id);
    }
}
